Relations
What is a Relation?
Let , and be sets. A relation from set to set is a subset of the Cartesian product . Given an ordered pair , we say that ” is related to by ” if and only if . We denote this by . We refer to as the domain of the relation, and to as the codomain of the relation.
Formally, a relation defined like so is called a binary relation as there are two sets involved. More generally, an -ary relation on sets is a subset of the Cartesian product .
Examples
Simple Explicit Given Relation
We can explicit relation by specifying the pairs that belong to it.
Let and .
The Cartesian product is then given by
Let’s define a relation from to as follows:
In this case, we can say that:
- (1 is related to 2 by R)
- (2 is related to 3 by R)
- (3 is related to 1 by R)
Since those pairs are in the relation .
And we can say that:
Since those pairs are not in the relation .
Relation Defined by a Condition
We can also define a relation using a specific condition. Let’s define a relation on where two integers are related if they share a common prime factor.
Let be a relation on defined as follows: for any integers and , if and only if there exists a prime integer such that divides both and .
We can say that:
- because both 6 and 9 are divisible by the prime number 3.
- because both 10 and 15 are divisible by the prime number 5.
- because there is no prime number that divides both 8 and 9.
Relations on Single Set
When a relation is defined on a single set, it is often referred to as a relation on that set. We simply consider the relation as a subset of the Cartesian product of the set with itself. We could have defined Example 1 as a relation on set instead of from to since both sets are the same.
Inverse Relations
Given a relation from set to set , the inverse relation of , denoted by , is a relation from set to set defined as follows:
Examples
Divisibility Relations
Let be a relation on the set of positive integers defined by if and only if divides (denoted as ).
Some of the pairs in this relation are:
The inverse relation would then be defined by if and only if divides , that is, is divisible by . Some of the pairs in this inverse relation are:
Graphs for Relations
A relation can be visually represented using a directed graph or a bipartite graph.
In a directed graph, each element of the sets involved in the relation is represented as a vertex, and a directed edge is drawn from vertex to vertex if .
In a bipartite graph, the vertices are divided into two disjoint sets, one for each set involved in the relation. An edge is drawn between vertex in the first set and vertex in the second set if .
Properties of Relations: Reflexivity, Symmetry, and Transitivity
Relations can have various properties. We will discuss three important properties: reflexivity, symmetry, and transitivity in this section.
Reflexivity
A relation on a set is said to be reflexive if every element in is related to itself. That is, for all , we have .
Symmetry
A relation on a set is symmetric if for all , if , then .
Transitivity
A relation on a set is transitive if for all , if and , then .
Please note the conditional nature of Transitivity. The property states if both and , then . That is, the every combination of the cartesian product need not be in the relation. The statement is vacously true if either or is false.
Transitive Closure
We can find the transititive closure of a relation by adding the minimum number of pairs to make it transitive. For example, if we have a relation , we can add the pair to make it transitive. The transitive closure of would then be .
Equivalence Relations & Partitions
The partition of a set is a way of dividing the set into non-overlapping subsets such that every element in the original set is included in exactly one subsets.
Provided the relation has been partitioned into these subsets, we can define an equivalence relation based on this partition. We say that two elements are related if they belong to the same subset in the partition. This relation will be always be reflexive, symmetric, and transitive, and forms an equivalence relation.
An equivalence relation is a relation that is reflexive, symmetric, and transitive.
Equivalence Classes
Suppose that there is an equivalace reation on a set . If is any particular element of , then the equivalence class of is the subset of consisting of all elements that are related to by the equivalence relation. We denote the equivalence class of by .
Formally, the equivalence class of is defined as follows:
Partial Orders
Let be a relation on a set . The relation is called a partial order if it is reflexive, antisymmetric, and transitive.
We say that a relation is antisymmetric if for all , if and , then .
We can say that a relation is not antisymmetric if we negate our definition of antisymmetry. If , then if , it must be that .
Hasse Diagrams
We can create a Hasse diagram for a partially ordered relation. A Hasse diagram is a graphical representation of a finite partially ordered set, where the elements are represented as vertices and the order relations are represented as edges. In a Hasse diagram, we omit the edges that can be inferred by transitivity and we arrange the vertices such that if , then vertex is placed lower than vertex .
Starting with the directed graph of the relation, we can create the Hasse diagram by removing self-loops (to account for reflexivity), removing edges that can be inferred by transitivity, and arranging the vertices vertically according to the order relation.
Partially and Totally Ordered Sets
Suppose we have a partially order relation on a set . We say a pair of elements are comparable if either or . If every pair of elements in the set are comparable, then we say that the partially ordered set is a total order relation (or linear order).
Let be a set that is partially ordered by relation . A subset is called a chain if every pair of elements in are comparable. A subset is called an antichain if no two distinct elements in are comparable. The length of this chain will be one less than the number of elements in the chain since the length is defined by the number of edges connecting the elements.
Maximal, Minimal Elements, Greatest, and Least Elements
An element is called a maximal element if there is no element such that and . Similarly, an element is called a minimal element if there is no element such that and .
An element is called the greatest element if for all , we have . Similarly, an element is called the least element if for all , we have .
An element can be both maximal and greatest, or minimal and least, but not necessarily. A set can have multiple maximal or minimal elements, but at most one greatest or least element.
One can quickly use a Hasse diagram to identify maximal, minimal, greatest, and least elements. Maximal elements are those at the top of the diagram with no edges going upwards, while minimal elements are at the bottom with no edges going downwards. The greatest element, if it exists, is the single element at the very top of the diagram, and the least element, if it exists, is the single element at the very bottom.